

import re
pattern = r'mr_\w+'
string = 'MR_SHOP mr_shop'
match = re.match(pattern,string,re.I)
print(match)
string = '项目名称MR_SHOP mr_shop'
match = re.match(pattern,string,re.I)
print(match)



pattern = r'mr_\w+'
string = 'MR_SHOP mr_shop'
match = re.match(pattern,string,re.I)
print('匹配值的起始位置：',match.start())
print('匹配值的结束位置：',match.end())
print('匹配位置的元组：',match.span())
print('要匹配的字符：',match.string)
print('匹配数据：',match.group())



pattern = r'[1-9]{1,3}(\.[0-9]{1,3}){3}'
string = '127.0.0.1 192.168.1.66'
match = re.findall(pattern.string)
print(match)
